home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / toolkitcomps / nsICommandLineHandler.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  144 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsICommandLineHandler.idl
  3.  */
  4.  
  5. #ifndef __gen_nsICommandLineHandler_h__
  6. #define __gen_nsICommandLineHandler_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsICommandLine; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsICommandLineHandler */
  21. #define NS_ICOMMANDLINEHANDLER_IID_STR "d4b123df-51ee-48b1-a663-002180e60d3b"
  22.  
  23. #define NS_ICOMMANDLINEHANDLER_IID \
  24.   {0xd4b123df, 0x51ee, 0x48b1, \
  25.     { 0xa6, 0x63, 0x00, 0x21, 0x80, 0xe6, 0x0d, 0x3b }}
  26.  
  27. /**
  28.  * Handles arguments on the command line of an XUL application.
  29.  *
  30.  * Each handler is registered in the category "command-line-handler".
  31.  * The entries in this category are read in alphabetical order, and each
  32.  * category value is treated as a service contractid implementing this
  33.  * interface.
  34.  *
  35.  * By convention, handler with ordinary priority should begin with "m".
  36.  *
  37.  * Example:
  38.  * Category             Entry          Value
  39.  * command-line-handler b-jsdebug      @mozilla.org/venkman/clh;1
  40.  * command-line-handler c-extensions   @mozilla.org/extension-manager/clh;1
  41.  * command-line-hanlder m-edit         @mozilla.org/composer/clh;1
  42.  * command-line-handler m-irc          @mozilla.org/chatzilla/clh;1
  43.  * command-line-handler y-final        @mozilla.org/browser/clh-final;1
  44.  *
  45.  * @status UNDER_REVIEW This interface is intended to be frozen, but it isn't
  46.  *                      frozen yet. Be careful!
  47.  * @note What do we do about localizing helpInfo? Do we make each handler do it,
  48.  *       or provide a generic solution of some sort? Don't freeze this interface
  49.  *       without thinking about this!
  50.  */
  51. class NS_NO_VTABLE nsICommandLineHandler : public nsISupports {
  52.  public: 
  53.  
  54.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOMMANDLINEHANDLER_IID)
  55.  
  56.   /**
  57.    * Process a command line. If this handler finds arguments that it
  58.    * understands, it should perform the appropriate actions (such as opening
  59.    * a window), and remove the arguments from the command-line array.
  60.    *
  61.    * @throw NS_ERROR_ABORT to immediately cease command-line handling
  62.    *        (if this is STATE_INITIAL_LAUNCH, quits the app).
  63.    *        All other exceptions are silently ignored.
  64.    */
  65.   /* void handle (in nsICommandLine aCommandLine); */
  66.   NS_IMETHOD Handle(nsICommandLine *aCommandLine) = 0;
  67.  
  68.   /**
  69.    * When the app is launched with the -help argument, this attribute
  70.    * is retrieved and displayed to the user (on stdout). The text should
  71.    * have embedded newlines which wrap at 76 columns, and should include
  72.    * a newline at the end. By convention, the right column which contains flag
  73.    * descriptions begins at the 24th character.
  74.    */
  75.   /* readonly attribute AUTF8String helpInfo; */
  76.   NS_IMETHOD GetHelpInfo(nsACString & aHelpInfo) = 0;
  77.  
  78. };
  79.  
  80. /* Use this macro when declaring classes that implement this interface. */
  81. #define NS_DECL_NSICOMMANDLINEHANDLER \
  82.   NS_IMETHOD Handle(nsICommandLine *aCommandLine); \
  83.   NS_IMETHOD GetHelpInfo(nsACString & aHelpInfo); 
  84.  
  85. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  86. #define NS_FORWARD_NSICOMMANDLINEHANDLER(_to) \
  87.   NS_IMETHOD Handle(nsICommandLine *aCommandLine) { return _to Handle(aCommandLine); } \
  88.   NS_IMETHOD GetHelpInfo(nsACString & aHelpInfo) { return _to GetHelpInfo(aHelpInfo); } 
  89.  
  90. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  91. #define NS_FORWARD_SAFE_NSICOMMANDLINEHANDLER(_to) \
  92.   NS_IMETHOD Handle(nsICommandLine *aCommandLine) { return !_to ? NS_ERROR_NULL_POINTER : _to->Handle(aCommandLine); } \
  93.   NS_IMETHOD GetHelpInfo(nsACString & aHelpInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHelpInfo(aHelpInfo); } 
  94.  
  95. #if 0
  96. /* Use the code below as a template for the implementation class for this interface. */
  97.  
  98. /* Header file */
  99. class nsCommandLineHandler : public nsICommandLineHandler
  100. {
  101. public:
  102.   NS_DECL_ISUPPORTS
  103.   NS_DECL_NSICOMMANDLINEHANDLER
  104.  
  105.   nsCommandLineHandler();
  106.  
  107. private:
  108.   ~nsCommandLineHandler();
  109.  
  110. protected:
  111.   /* additional members */
  112. };
  113.  
  114. /* Implementation file */
  115. NS_IMPL_ISUPPORTS1(nsCommandLineHandler, nsICommandLineHandler)
  116.  
  117. nsCommandLineHandler::nsCommandLineHandler()
  118. {
  119.   /* member initializers and constructor code */
  120. }
  121.  
  122. nsCommandLineHandler::~nsCommandLineHandler()
  123. {
  124.   /* destructor code */
  125. }
  126.  
  127. /* void handle (in nsICommandLine aCommandLine); */
  128. NS_IMETHODIMP nsCommandLineHandler::Handle(nsICommandLine *aCommandLine)
  129. {
  130.     return NS_ERROR_NOT_IMPLEMENTED;
  131. }
  132.  
  133. /* readonly attribute AUTF8String helpInfo; */
  134. NS_IMETHODIMP nsCommandLineHandler::GetHelpInfo(nsACString & aHelpInfo)
  135. {
  136.     return NS_ERROR_NOT_IMPLEMENTED;
  137. }
  138.  
  139. /* End of implementation class template. */
  140. #endif
  141.  
  142.  
  143. #endif /* __gen_nsICommandLineHandler_h__ */
  144.